package org.hhchat.leetcode.hashtable;

import java.util.HashSet;
import java.util.Set;

/**
 * Created this one by HMH on 2017/10/3.
 * 先把所有的种类都给妹妹发一份，直到发了一半的糖果停下来。
 */
public class code575_easy {
    static class Solution {
        public int distributeCandies(int[] candies) {
            Set<Integer> kinds = new HashSet<>();
            for (int candy : candies) kinds.add(candy);
            StringBuilder stringBuilder = new StringBuilder();
            return kinds.size() >= candies.length / 2 ? candies.length / 2 : kinds.size();

        }
    }
    public static void main(String[] args){

    }

}
